package com.wang.domain;

import org.springframework.beans.BeansException;
import org.springframework.context.ApplicationContext;
import org.springframework.context.ApplicationContextAware;

/**
 * 实现ApplicationContextAware接口
 *
 * @Author wly
 * @Date 2018/7/10 17:34
 */
public class ApplicationContextBean2 implements ApplicationContextAware {
    private ApplicationContext context;

    @Override
    public void setApplicationContext(ApplicationContext applicationContext) throws BeansException {
        this.context = applicationContext;
    }

    public void show() {
        System.out.println("ApplicationContextBean2 is：" + context);
    }
}
